﻿<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl">
  <xsl:output method="html" encoding="utf-8"  />
  <xsl:param name="FileName"></xsl:param>
  <xsl:param name="VersionSiteList"></xsl:param>
  <xsl:param name="DateSiteList"></xsl:param>
  <xsl:template match="/">
    <html>
      <head>
        <title>ToolKit Manager IE Site List</title>
        <script type="text/css">
          body {
          font-family: Arial, Helvetica, sans-serif;
          font-size: 12px;
          font-style: normal;
          }
          div {
          font-weight: bolder;
          }
        </script>
      </head>
      <body>
        <h2>
          ToolKit Manager IE Site List
        </h2>
        <h3>
          File :<xsl:value-of select="$FileName"/>
        </h3>
        <h3>
          Version :<xsl:value-of select="$VersionSiteList"/>
        </h3>
        <h3>
          Date :<xsl:value-of select="$DateSiteList"/>
        </h3>
        <br/>
        <table border="1">
          <caption>
            <b>Resume</b>
          </caption>
          <thead>
            <tr>
              <th>Action</th>
              <th>Description</th>
              <th>Count</th>
            </tr>
          </thead>
          <xsl:for-each select="Trakers/Traker">
            <tr>
              <td>
                <xsl:value-of select="Action"/> : <xsl:value-of select="Description"/>
              </td>
              <td>
                <xsl:value-of select="Complement"/>
              </td>
              <td>
                <xsl:value-of select="count(./Sites/Site)"/>
              </td>
            </tr>
          </xsl:for-each>
        </table>
        <br/>
        <h3>Details</h3>
        <br/>
        <xsl:for-each select="Trakers/Traker">
          <div>
            Date : <xsl:value-of select="DtRef"/>
          </div>
          <div>
            Action : <xsl:value-of select="Action"/> : <xsl:value-of select="Description"/>
          </div>
          <div>
            Description : <xsl:value-of select="Action"/> : <xsl:value-of select="Complement"/>
          </div>
          <xsl:choose>
            <xsl:when test="count(./Sites/Site) > 0">
              <table border="1">
                <caption>
                  <b>Sites</b>
                </caption>
                <thead>
                  <tr>
                    <th>Url</th>
                    <th>Compat Mode</th>
                    <th>Open-In</th>
                  </tr>
                </thead>
                <tbody>
                  <xsl:for-each select="./Sites/Site">
                    <tr>
                      <td>
                        <xsl:value-of select="."/>
                      </td>
                      <td>
                        <xsl:value-of select="./@CompatMode"/>
                      </td>
                      <td>
                        <xsl:value-of select="./@OpenIn"/>
                      </td>
                    </tr>
                  </xsl:for-each>
                </tbody>
              </table>
            </xsl:when>
          </xsl:choose>
          <br/>
        </xsl:for-each>
      </body>
    </html>
  </xsl:template>
</xsl:stylesheet>
